package com.yyk.yykywd.ui;

import android.content.Intent;
import android.view.View;

import com.yyk.yykywd.R;
import com.yyk.yykywd.base.BaseWebActivity;


/**
 * Created by Administrator on 2018/10/17 0017.
 */

public class WebActivity extends BaseWebActivity {

    private String url;
    private String title;

    @Override
    public void initView() {
        setBackArrow();
        Intent intent = getIntent();
        if (intent != null) {
            url = intent.getStringExtra("url");
            title = intent.getStringExtra("title");
            setTitle(title);
        }
    }

    @Override
    public View getBottomView() {
        return null;
    }

    /**
     * 处理穿过来的网址
     *
     * @return
     */
    @Override
    public String getUrl() {
        return url;
    }

    @Override
    protected void onStart() {

        super.onStart();
    }

    @Override
    protected void onResume() {
        super.onResume();


        //测试Cookies
        /*try {
            String targetUrl="";
            Log.i("Info","cookies:"+ AgentWebConfig.getCookiesByUrl(targetUrl="http://www.jd.com"));
            AgentWebConfig.removeAllCookies(new ValueCallback<Boolean>() {
                @Override
                public void onReceiveValue(Boolean value) {
                    Log.i("Info","onResume():"+value);
                }
            });
            String tagInfo=AgentWebConfig.getCookiesByUrl(targetUrl);
            Log.i("Info","tag:"+tagInfo);
            AgentWebConfig.syncCookie("http://www.jd.com","ID=IDHl3NVU0N3ltZm9OWHhubHVQZW1BRThLdGhLaFc5TnVtQWd1S2g1REcwNVhTS3RXQVFBQEBFDA984906B62C444931EA0");
            String tag=AgentWebConfig.getCookiesByUrl(targetUrl);
            Log.i("Info","tag:"+tag);
            AgentWebConfig.removeSessionCookies();
            Log.i("Info","removeSessionCookies:"+AgentWebConfig.getCookiesByUrl(targetUrl));
        }catch (Exception e){
            e.printStackTrace();
        }*/

    }
}